package com.yeung.swordoffer;

/**
 * 给定一个double类型的浮点数base和int类型的整数exponent。求base的exponent次方。
 * <p>
 * 保证base和exponent不同时为0
 */
public class 数值的整数次方 {
    public static void main(String[] args) {
        System.out.println(Power(2, 0));
    }

    public static double Power(double base, int exponent) {

        if (base == 0 && exponent == 0) return 0;
        double exp = (double) exponent;
        System.out.println(exp);
        return Math.pow(base, (double) exponent);
    }
}
